package uk.ac.cam.juliet.zedcat.socialnetworking;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;

/**
 *  Generates the correct string format for social network posting and GUI updating.
 *  @author Daniel Wright
 */

public class UpdateStringBuilder {

	private String catName;
	private Timestamp time;
	private String imageURL;
	private String tag;
	
	public UpdateStringBuilder(String catName, Timestamp timestamp, String tag, String imageURL) {
		this.catName = catName;
		this.time = timestamp;
		this.imageURL = imageURL;
		this.tag = tag;
	}
	
	public String toSocialNetworkString() {		
		String s = catName + " " + tag + ". http://www.srcf.ucam.org/juliet/images/uploads/" + imageURL;
		return s;
	}
	
	public String toGUIString() {
		final SimpleDateFormat datetimeFormatter = new SimpleDateFormat("dd/MM HH:mm:ss");
		String s = "[" + datetimeFormatter.format(time) + "] " + catName + " " + tag + ".";
		return s;
	}
	
}
